﻿// DataProductPropertyCtrl.cpp: 实现文件
//

#include "stdafx.h"
#include "zChecker.h"
#include "DataProductPropertyCtrl.h"


// CDataProductPropertyCtrl

IMPLEMENT_DYNAMIC(CDataProductPropertyCtrl, CMFCPropertyGridCtrl)

CDataProductPropertyCtrl::CDataProductPropertyCtrl()
{

}

CDataProductPropertyCtrl::~CDataProductPropertyCtrl()
{
}


BEGIN_MESSAGE_MAP(CDataProductPropertyCtrl, CMFCPropertyGridCtrl)
END_MESSAGE_MAP()



// CDataProductPropertyCtrl 消息处理程序

void CDataProductPropertyCtrl::Populate(ck::DataProductInfo* pProduct)
{
	this->RemoveAll();

	z_uint32 id = pProduct->GetID();
	z_uint32 code = pProduct->GetCode();
	const char* szType = pProduct->GetTypeAsString();
	const char* szName = pProduct->GetName();
	const char* szDescription = pProduct->GetDescription();
	
	CMFCPropertyGridProperty* pProjGroup = new CMFCPropertyGridProperty(_T("数据产品"));
	pProjGroup->AddSubItem(new CMFCPropertyGridProperty("名称", (_variant_t)szName, _T("")));
	pProjGroup->AddSubItem(new CMFCPropertyGridProperty("类型", (_variant_t)szType, _T("")));
	pProjGroup->AddSubItem(new CMFCPropertyGridProperty("描述", (_variant_t)szDescription, _T("")));

	this->AddProperty(pProjGroup);

}
